/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package network;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import weibo4j.model.WeiboException;

/**
 *
 * @author Administrator
 */
public class devideCommunity {

    static List<List> community = new ArrayList<List>();

    public static void main(String[] args) throws IOException, WeiboException, FileNotFoundException, InterruptedException, ClassNotFoundException, InstantiationException, IllegalAccessException, SQLException {
        communityData comDataOriginal = new communityData();//Already devided into 2 communities;
        int CommunitySize = 2;
        for (int i = 0; i < CommunitySize; i++) {
            community.add(new ArrayList<Integer>());
        }
        int NetworkSize = comDataOriginal.Si.size();
        for (int i = 0; i < NetworkSize; i++) {
            int c = comDataOriginal.Si.get(i) - 1;
            community.get(c).add(i);
        }

        for (int j = 1; j <3; j++) {
            comDataOriginal.devide(community, CommunitySize * j);
            System.out.println(community);
        }
        int i = 0;
        for (Integer s : comDataOriginal.Si) {
            i += 1;
            String uid = comDataOriginal.oldID.get(i);
            String username = comDataOriginal.data.username.get(uid);
            Integer kout = comDataOriginal.Kout.get(uid);
            Integer kin = comDataOriginal.Kin.get(uid);
            System.out.println(username + "\t" + s + "\t" + kout + "\t" + kin);
        }

    }
}
